﻿CREATE PROCEDURE [dbo].[AddMark]
	@MarkId uniqueidentifier,
    @ResponsibleParticipant uniqueidentifier,
    @NextParticipant uniqueidentifier,
	@Activity uniqueidentifier,
	@Model uniqueidentifier,
    @Name nvarchar(max),
	@Tag nvarchar(max),
	@DueDate datetime,
    @Weight int,
    @IsActive bit,
    @DateSet datetime,
    @CreatedBy uniqueidentifier,
    @IsDeleted bit,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO Mark 

	(MarkId, ResponsibleParticipant, NextParticipant, Activity, Model,
     Name, Tag, DueDate, [Weight], IsActive, DateSet, CreatedBy, IsDeleted, CreatedOn, LastChanged, LastChangedBy)

	VALUES 

	(@MarkId, @ResponsibleParticipant, @NextParticipant, @Activity, @Model,
     @Name, @Tag, @DueDate, @Weight, @IsActive, @DateSet, @CreatedBy, @IsDeleted, @CreatedOn, @LastChanged, @LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM Mark WHERE MarkId=@MarkId

RETURN 0